﻿using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrismRegionNavigation.ViewModels.Pages
{
    public class ViewBViewModel : INavigationAware
    {
        public string Title { get; set; } = "View B";

        /// <summary>
        /// 是否允许重复导航进来
        /// 如果是false 会重复创建对象 新的对象
        /// 如果是true 显示前对象
        /// </summary>
        /// <param name="navigationContext"></param>
        /// <returns></returns>
        public bool IsNavigationTarget(NavigationContext navigationContext)
        {
            //是否允许重复导航进来
            return true;
        }

        /// <summary>
        /// 从当前view导航出去的时候触发
        /// 从当前页面离开 去另外一个页面
        /// </summary>
        /// <param name="navigationContext"></param>
        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
            //从当前view导航出去的时候触发
        }

        /// <summary>
        /// 打开当前view的时候触发
        /// </summary>
        /// <param name="navigationContext"></param>
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            //打开当前view的时候触发
            //string value1 = navigationContext.Parameters.GetValue<string>("parameter1");
        }
    }
}
